//生产环境的配置
const path = require('path');
const copyPlugin = require('copy-webpack-plugin');
const htmlPlugin = require('html-webpack-plugin');
const fs = require('fs');

module.exports = {
  mode: 'development',
  //入口文件
  entry: './src/app.js',
  //出口
  output: {
    filename: 'app-[hash].js',
    path: path.resolve(__dirname, './dist/')
  },
  plugins: [
    new htmlPlugin({
      title: '拉勾后台管理系统',
      template: './src/index.html',
      filename: 'index.html'
    }),
    //文件的拷贝
    new copyPlugin([
      {
        from: './src/public/', to: './public/'
      }
    ])
  ]
}